package cn.virens.web.components.open.wxmp.oauth;

import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.mp.bean.result.WxMpUser;

public interface WxMpOauthSevice {
	void switchoverTo(String appid);

	/**
	 * 生成JS API签名信息
	 * 
	 * @param  url
	 * @return
	 * @throws Exception
	 */
	WxJsapiSignature signJsapi(String url) throws Exception;

	/**
	 * 获取微信登录后的用户信息
	 * 
	 * @param  state
	 * @return
	 * @throws Exception
	 */
	WxMpUser oauth2GetUserinfo(String state) throws Exception;

	/**
	 * 通过微信回调获取实际请求地址
	 * 
	 * @param  code
	 * @param  state
	 * @return
	 * @throws Exception
	 */
	String oauth2GetTargetURI(String code, String state) throws Exception;

	/**
	 * 生成授权地址
	 * 
	 * @param  redirectURI
	 * @param  targetURI
	 * @return
	 * @throws Exception
	 */
	String oauth2BuildAuthURI(String redirectURI, String targetURI) throws Exception;

}
